package org.tls.ylt.order.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tls.ylt.common.result.Result;
import org.tls.ylt.order.service.OrderService;
import org.tls.ylt.vo.order.OrderCountQueryVo;

/**
 * statistic本应是单独的服务，通过feign调用得到其他服务的数据，这里为了简便整合到order中
 * */
@Api(tags = "统计管理接口")
@RestController
@RequestMapping("/admin/statistics")
public class StatisticsController {

    @Autowired
    OrderService orderService;

    @ApiOperation(value = "获取订单统计数据")
    @GetMapping("getCountMap")
    public Result getCountMap(@ApiParam(name = "orderCountQueryVo", value = "查询对象", required = false) OrderCountQueryVo orderCountQueryVo) {
        return Result.ok(orderService.getCountMap(orderCountQueryVo));
    }
}